SSW Update - Do you know that you should never throw an exception using System.Exception?
Microsoft Gold Partner Logo

 

[ the cutting edge ]

G'Day Developers!

While everyone knows that "catch (Exception ex)" is bad, no one has really noticed that "throw Exception()" is actually the root of all evil.

System.Exception is a very extensive class, and it is inherited by all other exception classes. If you throw an exception with the code "throw Exception()", what you need subsequently to handle the exception will be the infamous "catch (Exception ex)".

As a standard, you should use an exception class with the name that best describes the exception's detail. All exception classes in .NET Framework follow this standard very well. As a result, when you see exceptions like FileNotFoundException or DivideByZeroException, you know what's happening just by looking at the exception's name. .NET Framework has provided us a comprehensive list of exception classes that can we can use. If you really can't find one that is suitable for the situation, then create your own exception class with the name that best describes the exception (eg: EmployeeListNotFoundException).

Also, System.ApplicationException should be avoided as well unless it's an exception related to the application. While it's acceptable and should be used in certain cases, be aware that using it massively will be just as bad as "throw (Exception ex)".

We have a program called SSW Code Auditor to check for this rule.

To see more rules like this, go to the SSW Rules page.

Cheers until next time, Adam
SSW Chief Architect and Microsoft Regional Director, Australia 

Got a comment for Adam? 6164616d636f67616e407373772e636f6d2e6175

SPECIAL Sydney .NET User Group -
The best place to learn .NET for free in Sydney

User Group

5 days to go!

Sydney .NET User Group
Wednesday 18th July 2007
5:45pm - 9:00pm
Microsoft, Sydney

Adam Cogan presents: Next Generation Visual Studio Team System

Microsoft Visual Studio Team System has given us the integration of development, project management, testing and analysis tool that was missing in the previous version of Visual Studio. In this talk you will learn about what’s coming up in the next version of Visual Studio Orcas, Visual Studio Team System 2008 (Rosario) and Team Foundation Server 2008. You will also see what’s currently hot on the Visual Studio widgets scene with a demo-driven session on the most useful tools for Visual Studio Team System

Features covered include:

  • What’s coming in Visual Studio Orcas Beta 2
  • What’s new in Rosario and Team Foundation Server 2008
  • Hot widgets: Team Foundation Power Tools, MSSCCIs, Team Plain, Diff Dog, SSW Code Auditor, MS Build GUI and much more!
See You There!!!| Sorry I can't make it

Canberra .NET User Group -
The best place to learn .NET for free in Canberra

User Group

6 days to go!

Canberra .NET Developers User Group
Thursday 19th July 2007
Lunchtime 12:30pm - 1:30pm
King O'Malley's Irish Pub
131 City Walk
Canberra City
Evening 4:30pm-6:00pm
Microsoft Canberra Branch
Walter Turnbull Building
Level 2, 44 Sydney Ave
Barton ACT

How to use Access 2007 and SharePoint 2007 together

Adam Cogan will discuss how to use Access 2007 and SharePoint 2007 together. SharePoint 2007 and Access 2007 have had an enormous amount of work done in this version and they work together beautifully. SharePoint 2007 to many is a web version of Access. (this session will run for 40 mins during the lunch time presentation).

Adam will cover:

  • using SharePoint data in your Access solution
  • using Access to report on your SharePoint data
  • upsizing your Access data to SharePoint and then continue with Access as the frontend
  • upsizing your entire Access solution to SharePoint and then finish using Access as your platform

See You There!!!| Sorry I can't make it

UTS SQL and .NET Courses

User Group

25 days to go!

Tuesday 7th August 2007
6:00pm - 9:00pm
UTS City Campus
Building 10, Level 3, Room 210
Sydney

Developing Windows and Web Applications using Visual Studio.NET (C# and VB.NET) (Starting 09/08/2007)

This course introduces students to the Microsoft .NET 2.0 Framework through hands-on exercises and live demos. Both C# and VB .NET code is provided side-by-side giving the students a deeper understanding of the commonalities between the languages. Students will also get a glimpse of what is possible using .NET 3.0.

SQL Server 2005 for Developers and BI (Starting 07/08/2007)

This course provides attendees with the knowledge necessary to take advantage of new features provided by SQL Server 2005. It provides a comprehensive overview of technologies, security, and design best practices with particular emphasis on hands-on skills.

Application Details

To apply and reserve a place in the course of your preference, please complete the application form https://it.uts.edu.au/course/shortcourse/shortcourses_apply.pdf with your credit card details and fax to 9514 1844 without delay.

Please direct any queries to Julie Lui ph: 9514 1806 or Elaine Lawrence ph: 9514 1861 or email: [email protected]

See You There!!!| Sorry I can't make it

Wollongong .NET User Group -
The best place to learn .NET for free in Wollongong

User Group

26 days to go!

Wollongong .NET User Group
Wednesday 8th August 2007
6:30pm - 8:30pm
CSC Wollongong campus
Coniston Technology Park
Mt St Thomas

Visual Studio for Database Professionals (Data Dude)

In this session Adam Cogan will provide an introduction to Visual Studio Team Edition for Database Professionals and will cover: schema maintenance, unit testing and data generation, including a discussion on ways of extending this newly released product.

See You There!!!| Sorry I can't make it

Featured Product: SSW Code Auditor

Keep your code *healthy* with SSW Code Auditor - the best .NET Refactor Tool SSW Upsizing Pro

Are you looking to eradicate bugs and ensure consistency? SSW Code Auditor is a tool that allows developers to take control of your code, ensuring large, complex source code can be simplified, cleaned and maintained. The built-in rules focus on the most popular .NET languages (C#, VB.NET) for both Windows Forms and ASP.NET; however, the flexibility of SSW Code Auditor allows the developer to add their own rules to target any language in any text file.

 

More on SSW Code Auditor

Advertise with SSW

If you would like to advertise your product or service with SSW or would like to find out more about various advertising opportunities, please email your enquiry to 736f7068696562656c6c65407373772e636f6d2e6175
or call: +61 2 9953 3000.

Proudly developed by SSW Sydney Web Design